package com.example.demo;

import com.example.demo.pojo.Test;
import com.example.demo.pojo.Test1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by dingkl on 2017/7/10.
 */
@RestController
public class TestController {

    @Value("${com.dkl.test1}")
    private String test1;

    @Value("${com.dkl.test2}")
    private String test2;

   /* @Autowired
    Test test;*/

   @Autowired
    Test1 test;

    @RequestMapping("/test1")
    public String test1(){
        return test1;
    }

    @RequestMapping("/test2")
    public String test2(){
        return test2;
    }

    /*@RequestMapping("/test3")
    public String test3(){
        return test.getTest1()+","+test.getTest2();
    }*/

    @RequestMapping("/test4")
    public String test4(){
        return test.getTest1();
    }
}
